﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace StarfleetCommanderDomain.UserModels
{
    public class PrettyUser
    {
        public Guid UserId { get; private set; }
        //public Guid ApplicationId { get; private set; }
        public string UserName { get; private set; }
        public DateTime LastLogin { get; private set; }
        public bool IsApproved { get; private set; }
        public DateTime Created { get; private set; }
        public string Email { get; private set; }

		public string AllianceAppliedTo { get; private set; }
		public string Alliances{ get; private set; }
		

        public bool HasToken { get; private set; }
        public bool IsMember { get; private set; }
        public bool IsAdmin { get; private set; }
        public int Scans { get; private set; }

        public string Comment
        {
            get;
           private set;
        }
	
		

        public PrettyUser(IMembership membership,string userName, bool isMember,int scans,bool isAdmin,
			string comment,bool hasToken,string alliances, string alliancesAppliedTo)
        {

            UserId = membership.UserId;
            UserName = userName;
            LastLogin = membership.LastLoginDate;
            
            IsApproved = membership.IsApproved;
            Created = membership.CreateDate;
            Email = membership.Email;

            IsMember = isMember;
            IsAdmin = isAdmin;
            
            HasToken = hasToken;
            Scans = scans;
            Comment = comment;

            AllianceAppliedTo = alliancesAppliedTo;
            Alliances = alliances;

        }
		public class AllianceUserStatus
		{
			public  string ShortName { get; private set; }
			public  bool IsExtreme { get; private set; }
			public  int AllianceId { get; private set; }
			public  MemberStatus Status { get; private set; }
			public AllianceUserStatus(string shortName, bool isExtreme, int allianceId, MemberStatus status)
			{
				ShortName = shortName;
				IsExtreme = isExtreme;
				AllianceId = allianceId;
				Status = status;
			}
		}
		//public void Approve()
		//{
		//    if (IsApproved) return;
		//    UserPersistance.Approve(UserId);
            
		//}

		//public void MakeMember()
		//{
		//    UserPersistance.AddRole(this.UserName, "SfcMember");
		//}
		//public void MakeAdmin()
		//{
		//    UserPersistance.AddRole( this.UserName, "SfcAdmin");
		//}
    }
}
